<template lang="html">
  <div class="all-mine">
    <div class="user-top">
      <div class='user'>
          <a href="javascript:void(0)" class="clearfix">
              <img :src="img_url+'/mine/top-img.png'" alt="" class="topbg">
          </a>
          <div class='portrait' v-if='!user.head_pic'>
            <img :src="img_url+'/default.png'" alt="用户头像" width="50px" height="50px" style="border-radius:25px;">
          </div>
          <div class='portrait' v-if='user.head_pic'>
            <img :src="user.head_pic" alt="用户头像" width="50px" height="50px" style="border-radius:25px;">
          </div>
          <p class='userName'>{{user.nickname}}</p>
          <div class="zhye">
              <p>账户余额</p>
              <a href="{:U('Mobile/User/balance_bill')}">
                <p><span>{{user.user_money}}</span><em>元</em></p>
              </a>
          </div>
      </div>
      <a class='announcement'>
          <img :src="img_url+'/mine/mine/anno.png'" alt="">
          <p>通知中心</p>
      </a>
    </div>
    <div class='order'>
      <a class='order-top' href="{:U('mobile/order/order')}?type=1">
          <img :src="img_url+'/mine/mine/sp.png'" alt="" class="order-img">
          <span>我的订单</span>
          <em>全部订单</em>
      </a>
      <div class='order-bottom clearfix'>
          <a href="{:U('mobile/order/order')}?type=1">
              <dl>
                  <dd class='clearfix'>
                      <img :src="img_url+'/mine/mine/dfk.png'" alt="" class="fk">
                          <div class="to-tip" v-if='user.order.dfk!=0'>
                              <span class="tip">{{user.order.dfk}}</span>
                          </div>
                  </dd>
                  <dt>待付款</dt>
              </dl>
          </a>
          <a href="{:U('mobile/order/order')}?type=2">
              <dl>
                  <dd class='clearfix'>
                      <img :src="img_url+'/mine/mine/dfh.png'" alt="" class="dfh">
                      <div class="to-tip" v-if='user.order.dfh!=0'>
                          <span class="tip">{{user.order.dfh}}</span>
                      </div>
                  </dd>
                  <dt>待发货</dt>
              </dl>
          </a>
          <a href="{:U('mobile/order/order')}?type=3">
              <dl>
                  <dd class='clearfix'>
                      <img :src="img_url+'/mine/mine/jgxs.png'" alt="" class="yfh">
                      <div class="to-tip" v-if='user.order.jg_xs!=0'>
                          <span class="tip">{{user.order.jg_xs}}</span>
                      </div>
                  </dd>
                  <dt>加工/销售</dt>
              </dl>
          </a>
          <a href="{:U('mobile/order/order')}?type=4">
              <dl>
                  <dd class='clearfix'>
                      <img :src="img_url+'/mine/mine/thsh.png'" alt="" class="yfh">
                      <if condition="$ywc gt 0">
                          <div class="to-tip" v-if='user.order.th_sh!=0'>
                              <span class="tip">{{user.order.th_sh}}</span>
                          </div>
                      </if>
                  </dd>
                  <dt>提货/售后</dt>
              </dl>
          </a>
      </div>
  </div>
  <div class='main'>
    <a class='flex-row' href="{:U('mobile/user/invitee')}">
        <img :src="img_url+'/mine/leader_person.png'" alt="" class="lp">
        <p class="red">邀请好友</p>
    </a>
    <a class='flex-row' href="{:U('mobile/user/red_package')}">
        <img :src="img_url+'/mine/mine/hb.png'" alt="" class="hb">
        <p class="red">我的红包</p>
    </a>
    <a class='flex-row' href="{:U('mobile/setting/question')}">
        <img :src="img_url+'/mine/mine/question.png'" alt="" class="dz">
        <p>常见问题</p>
    </a>
    <a class='flex-row' href='tel:{$phone}'>
        <img :src="img_url+'/mine/mine/kf.png'" alt="" class="kf">
        <p>在线客服</p>
    </a>
    <a class='flex-row' href="{:U('mobile/setting/monitoring')}">
        <img :src="img_url+'/mine/mine/jk.png'" alt="" class="yhk">
        <p>物联网+监控</p>
    </a>
    <a class='flex-row' href="{:U('mobile/setting/index')}">
        <img :src="img_url+'/mine/mine/sz.png'" alt="" class="sz">
        <p>设置</p>
    </a>
</div>
  <a href="{:U('mobile/user/logout')}" class='exit'>安全退出</a>
  <p class="index-tips">K金网版权所有@2018</p>
  </div>


</template>

<script>
import global from '../global.vue'
import axios from 'axios'
import $ from 'jquery'

export default {
  data(){
    return {
      img_url:global.img_url,
      base_url:global.base_url,
      user:[]
    }
  },
  mounted:function(){
    var that = this;
    $.ajax({
      url:'https://m.kjinwang.com/api/User/index',
      type:'GET',
      dataType:'JSON',
      data:{user_token:'15aaf033f1cf3c596e0a92a5706e6b95'},
      success:function(res){
        console.log(JSON.parse(res));
        that.user = JSON.parse(res)
      },
      fail:function(err){

      }
    })
  },
  methods:{

  }
}
</script>

<style src='../assets/css/mine.css'>
</style>
